home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_01_04
/
1n04008a
< prev
next >
Wrap
Text File
|
1990-03-01
|
1KB
|
60 lines
/*
Header: FileSrch
Version: 1.00 03-Mar-1990
Language: ANSI C with MS-DOS extensions
Environ: MS-DOS
Purpose: This module will search subdirectories for files.
Written by: Scott Robert Ladd
*/
#if !defined(FILESRCH_H)
#define FILESRCH_H 1
#if defined(_MSC_VER) || defined(_QC) || defined(__WATCOMC__)
#pragma pack(1)
#endif
typedef
struct
{
char reserved[21];
char attrib;
unsigned time;
unsigned date;
long size;
char name[13];
}
FILE_DATA;
#if defined(_MSC) || defined(_QC) || defined(__WATCOMC__)
#pragma pack()
#endif
/* attribute bit masks */
#define ATTR_READONLY 0x01 /* read only */
#define ATTR_HIDDEN 0x02 /* hidden */
#define ATTR_SYSTEM 0x04 /* system */
#define ATTR_VOLABEL 0x08 /* volume label */
#define ATTR_DIRECTORY 0x10 /* directory */
#define ATTR_ARCHIVE 0x20 /* archive */
#define ATTR_ALL 0x3F /* all files */
/* prototypes */
void TreeFind(char * spec,
char attrib,
char * top_dir,
void (* handler)(char * dir, FILE_DATA * fd));
int WildMatch(char * name, char * tmpl);
int FindFirst(char * spec, char attrib, FILE_DATA * fd);
int FindNext(FILE_DATA * fd);
#endif